package assist.domain.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Set;


@Deprecated
public class EventQuery extends ArrayList<EventQuery.Row> implements Serializable
{    
    private static final long serialVersionUID = 1L;
    private Types types;
    private Set<Player> players;
    private Team team;
    private Set<Game> games;
    private String[] headers;
    private Set<Player> opponents;    

    public EventQuery()
    {
        
    }
    
    public static class Types implements Serializable
    {
        /**
         * 
         */
        private static final long serialVersionUID = 1L;
        private Boolean evenStrength = true;
        private Boolean powerPlay = false;
        private Boolean shortHanded = false;
        private Boolean shotsOnGoal = true;
        private Boolean blockedShots = false;
        private Boolean missedShots = true;
        private Boolean individualPlayers = true;
        private Boolean allPlayers = false;

        public Types(){}
        public void setEvenStrength(Boolean value)
        {
            this.evenStrength = value;
        }

        public void setPowerPlay(Boolean value)
        {
            this.powerPlay = value;
        }

        public void setShortHanded(Boolean value)
        {
            this.shortHanded = value;           
        }

        public void setShotsOnGoal(Boolean value)
        {
            this.shotsOnGoal = value;        
        }

        public void setBlockedShots(Boolean value)
        {
            this.blockedShots = value;     
        }

        public void setMissedShots(Boolean value)
        {
            this.missedShots = value;           
        }
        public boolean getEvenStrength()
        {           
            return this.evenStrength;
        }
        public boolean getPowerPlay()
        {            
            return this.powerPlay;
        }
        public boolean getShortHanded()
        {
            return this.shortHanded;
        }
        public boolean getMissedShots()
        {           
            return this.missedShots;
        }
        public boolean getBlockedShots()
        {
            return this.blockedShots;
        }
        public boolean getShotsOnGoal()
        {
            return this.shotsOnGoal;
        }
        public boolean getIndividualPlayers()
        {           
            return this.individualPlayers;
        }
        public boolean getAllPlayers()
        {            
            return this.allPlayers;
        }        
        public void setIndividualPlayers(Boolean value)
        {
            this.individualPlayers = value;
        }
        public void setAllPlayers(Boolean value)
        {
            this.allPlayers = value;
        }
    }

    public static class Row implements Serializable,Comparable<Row>
    {
        private static final long serialVersionUID = 1L;
        private String title;
        private Integer rate;
        private Integer gamesPlayed;
        private Integer shotsFor;
        private Integer shotsAgainst;

        Row(){}
        public Row(String title, Integer gamesPlayed, Integer shotsFor, Integer shotsAgainst, Integer rate)
        {
            this.setTitle(title);
            this.setShotsFor(shotsFor);
            this.setShotsAgainst(shotsAgainst);
            this.setRate(rate);
            this.setGamesPlayed(gamesPlayed);
        }

        /**
         * @param title the title to set
         */
        public void setTitle(String title)
        {
            this.title = title;
        }

        /**
         * @return the title
         */
        public String getTitle()
        {
            return title;
        }

        /**
         * @param rate the rate to set
         */
        public void setRate(Integer rate)
        {
            this.rate = rate;
        }

        /**
         * @return the rate
         */
        public Integer getRate()
        {
            return rate;
        }

        /**
         * @param shotsFor the shotsFor to set
         */
        public void setShotsFor(Integer shotsFor)
        {
            this.shotsFor = shotsFor;
        }

        /**
         * @return the shotsFor
         */
        public Integer getShotsFor()
        {
            return shotsFor;
        }

        /**
         * @param shotsAgainst the shotsAgainst to set
         */
        public void setShotsAgainst(Integer shotsAgainst)
        {
            this.shotsAgainst = shotsAgainst;
        }

        /**
         * @return the shotsAgainst
         */
        public Integer getShotsAgainst()
        {
            return shotsAgainst;
        }

        /**
         * @param gamesPlayed the gamesPlayed to set
         */
        public void setGamesPlayed(Integer gamesPlayed)
        {
            this.gamesPlayed = gamesPlayed;
        }

        /**
         * @return the gamesPlayed
         */
        public Integer getGamesPlayed()
        {
            return gamesPlayed;
        }
        @Override
        public int compareTo(Row row)
        {            
            return row.rate.compareTo(this.rate);
        }

    }

    public void setTeam(Team team)
    {
        this.team = team;        
    }

    public void setGames(Set<Game> games)
    {
        this.games = games;  
    }

    public void setPlayers(Set<Player> players)
    {
        this.players = players;        
    }

    public void setTypes(Types types)
    {
        this.types = types;        
    }
    
    public Types getTypes()
    {
        return this.types;
    }

    public String getTitle()
    {
        String label = "";
        if (this.types.shotsOnGoal)
        {
            label += "Shots On Goal + ";
        }
        if (this.types.missedShots)
        {
            label += "Missed Shots + ";
        }
        if (this.types.blockedShots)
        {
            label += "Blocked Shots + ";
        }        
        label = label.substring(0, label.length() - 3);
        label += " (";
        if (this.types.evenStrength)
        {
            label += "Even Strength, ";
        }
        if (this.types.powerPlay)
        {
            label += "Power Play, ";
        }
        if (this.types.shortHanded)
        {
            label += "Short Handed, ";
        }        
        label = label.substring(0, label.length() - 2 );
        return label+")";       
    }

    public void setHeaders(String ... headers)
    {
        this.headers = headers;        
    }

    public String [] getHeaders()
    {
        return this.headers;
    }

    public Team getTeam()
    {
        // TODO Auto-generated method stub
        return this.team;
    }

    public Set<Player> getPlayers()
    {
        // TODO Auto-generated method stub
        return this.players;
    }

    public Set<Game> getGames()
    {
       return this.games;
    }

    public void setOpponents(Set<Player> opponents)
    {
        this.opponents = opponents;
    }    
    
    public Set<Player> getOpponents()
    {
        // TODO Auto-generated method stub
        return this.opponents;
    }    

}
